import Vue from 'vue'
import VueRouter from 'vue-router'
import routes from './constantRoutes'
import './reolse'
Vue.use(VueRouter)

const creatRoute = () => {
  return new VueRouter({
    mode: 'history',
    routes
  })
}
const router = creatRoute()
// 重置路由
export const routerReset = () => {
  const newRouter = creatRoute()// 重新创建初始化路由对象
  router.addRoute.matcher = newRouter.matcher
}
export default router
